package com.yn.bsc.vo;

import com.yn.bsc.model.SiteStations;

import javax.persistence.Column;
import java.text.DecimalFormat;

/**
 * Created by zyl on 2017/9/21.
 */
public class SiteStationsVo extends SiteStations implements Comparable<SiteStationsVo>{

    @Column(name = "urban_name_cn")
    private String urbanNameCn;

    @Column(name = "suburban_name_cn")
    private String suburbanNameCn;

    @Column(name = "siteCount")
    private int siteCount;

    @Column(name = "unHealthSiteCount")
    private int unHealthSiteCount;

    private double ratio;

    private int ranking;

    public String getUrbanNameCn() {
        return urbanNameCn;
    }

    public void setUrbanNameCn(String urbanNameCn) {
        this.urbanNameCn = urbanNameCn;
    }

    public String getSuburbanNameCn() {
        return suburbanNameCn;
    }

    public void setSuburbanNameCn(String suburbanNameCn) {
        this.suburbanNameCn = suburbanNameCn;
    }

    public int getSiteCount() {
        return siteCount;
    }

    public void setSiteCount(int siteCount) {
        this.siteCount = siteCount;
    }

    public int getUnHealthSiteCount() {
        return unHealthSiteCount;
    }

    public void setUnHealthSiteCount(int unHealthSiteCount) {
        this.unHealthSiteCount = unHealthSiteCount;
    }

    public  Double getRatio() {
        if (siteCount != 0){
            return  Double.valueOf((siteCount - unHealthSiteCount)) / Double.valueOf(siteCount) ;
        }
        return ratio;
    }

    public void setRatio(double ratio) {
        this.ratio = ratio;
    }

    public int getRanking() {
        return ranking;
    }

    public void setRanking(int ranking) {
        this.ranking = ranking;
    }

    @Override
    public int compareTo(SiteStationsVo o) {
        return o.getRatio().compareTo(this.getRatio());
    }
}
